<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        h2{
            background-color: blue;
        }
    </style>
</head>
<body>

<div>
    <h2>aaaa</h2>
    <ul style="display: none;margin-top: 100px;background-color: red">
        <li>mmm</li>
        <li>nnn</li>
        <li>dddd</li>
    </ul>
</div>
<script>
var h2 = document.getElementsByTagName('h2')[0];
var ul = document.getElementsByTagName('ul')[0];
var t;
h2.onmouseover = function(){
    ul.style.display='block'
}
h2.onmouseout = function(){
    t = setTimeout(function(){
        ul.style.display='none'
    },200)
}
ul.onmouseover = function(){
    clearTimeout(t);
    ul.style.display='block'
}

ul.onmouseout = function(){
    ul.style.display='none'
}



</script>
</body>
</html>